import request from '@/utils/request';

// 获取反馈分页列表
export const getFeedbackPage = (params) => {
  return request({
    url: '/feedback/page',
    method: 'get',
    params
  });
};

// 更新反馈状态
export const updateFeedbackStatus = (id, data) => {
  return request({
    url: `/feedback/${id}/status`,
    method: 'put',
    data
  });
};

// 删除反馈
export const deleteFeedback = (id) => {
  return request({
    url: `/feedback/${id}`,
    method: 'delete'
  });
};

// 反馈状态枚举
export const FeedbackStatus = {
  NEW: 'NEW', // 新建
  PROCESSING: 'PROCESSING', // 处理中
  COMPLETED: 'COMPLETED', // 已完成
  REJECTED: 'REJECTED', // 已拒绝
};

// 反馈状态标签映射
export const FeedbackStatusLabels = {
  [FeedbackStatus.NEW]: '新建',
  [FeedbackStatus.PROCESSING]: '处理中',
  [FeedbackStatus.COMPLETED]: '已完成',
  [FeedbackStatus.REJECTED]: '已拒绝',
};